package test.designmode.buttonlistener3;

/**
 * Created by shuoGG on 2018/8/10
 *
 * Button点击时触发播放音乐和显示图片
 */
public class Main {

    public static void main(String[] args) throws Exception {
        HandlerPlayMusic h1 = new HandlerPlayMusic();
        HandlerShowPic h2 = new HandlerShowPic();
        Button butt = new Button();
        butt.addHandler(h1, "playMusic", "小小粉刷匠");
        butt.addHandler(h2, "showPic", "toge.jpg");
        // 触发所有任务
        butt.click();
    }

}
